from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError


# 审批流类
class Workflow(models.Model):
    _inherit = 'sb.workflow'

    workflow_type = fields.Selection(selection_add=[
        ('product_apply', 'Product Apply'),
    ], ondelete={'activity': 'cascade'})
    # 关联销售单据
    product_apply_id = fields.Many2one('product.apply', string="Product Apply", ondelete="cascade")
    line_ids = fields.One2many('product.apply.line', related="product_apply_id.line_ids")
